# 替换为实际参数
ACCESS_KEY_ID="LTAI5tExampleKey123"
ACCESS_SECRET="ydIl0OCNExampleSecret456"
TIMESTAMP=$(date +%s000)  # 生成毫秒级时间戳
NONCE=$(uuidgen | tr -d '-')

# 生成签名
SIGN_STR="accessKeyId=${ACCESS_KEY_ID}&timestamp=${TIMESTAMP}&nonce=${NONCE}"
SIGNATURE=$(echo -n "$SIGN_STR" | openssl dgst -hmac "$ACCESS_SECRET" -sha1 -binary | base64)

# 发送请求
curl -v "https://bailian.aliyuncs.com/v2/file/lease" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bailian ${ACCESS_KEY_ID}:${SIGNATURE}:${TIMESTAMP}:${NONCE}" \
  -d '{
    "FileName": "test.jpg",
    "FileSize": 1024,
    "Md5": "d41d8cd98f00b204e9800998ecf8427e",
    "WorkspaceId": "llm-emoosscmhb9fcos0",
    "CategoryId": "cate_97918ee6fab64a3c88c3e13982989352_11410445",
    "CategoryType": "SESSION_FILE"
  }'